﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace SIAD.Model
{
    class Case : INotifyPropertyChanged
    {
        #region Constructor
        public Case(Common.CASE_TYPE type)
        {
            _theCase = type;
        }
        #endregion
        protected Common.CASE_TYPE _theCase;
        /// <summary>
        /// Permet de représenter une case
        /// </summary>
        public Common.CASE_TYPE theCaseType
        {
            get { return _theCase; }
            set
            {
                if (_theCase != value)
                {
                    _theCase = value;
                    OnPropertyChanged("theCaseType");
                }
            }
        }

        /// <summary>
        /// Permet de savoir si il faut notifier
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// Permet de notifier une propriété
        /// </summary>
        /// <param name="propertyName">Le nom de la propriété</param>
        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                var e = new PropertyChangedEventArgs(propertyName);
                handler(this, e);
            }
        }
    }
}
